/* OpenGLMapView */

#import <Cocoa/Cocoa.h>
#import <OpenGL/gl.h>
#import "TileMap.h"
#import "TilePieceList.h"
#import "TileGroupList.h"
#import "TileList.h"
#import "ColorPalette.h"
#import "UnitList.h"
#import "DATManager.h"
#import "Utility.h"
#import "LocationList.h"


@interface OpenGLMapView : NSOpenGLView
{
	TileMap			* _map;
	TilePieceList	* _pieceList;
	TileGroupList	* _groupList;
	TileList		* _tileList;
	ColorPalette	* _palette;
	
	NSScroller		* _horizontalScroller;
	NSScroller		* _verticalScroller;
	
	NSRect			  _viewPort;
	NSPoint			  _originPoint;
	
	GLuint			* _bufferID;
	IBOutlet id		miniMapView;
}

- (float)scaleFactor;
- (void)reshape;
- (void)setTileMap:(TileMap *)map;
- (void)setTilePieceList:(TilePieceList *)pieceList;
- (void)setTileGroupList:(TileGroupList *)groupList;
- (void)setTileList:(TileList *)tileList;
- (void)setPalette:(ColorPalette *)palette;
- (void)timerFired:(NSTimer *)aTimer;

- (void)buildGeometry;

/* Scroller Support */
- (void)_doScroller:(id)sender;
- (void)setHorizontalScroller:(NSScroller *)scroller;
- (void)setVerticalScroller:(NSScroller *)scroller;


- (NSRect)visibleMapRect;
@end
